

#ifndef __COCAN_H__
#define __COCAN_H__

#include "typedef.h"

#define CRC8_TABLELENGTH 	(256U)

#define CRC32_TABLE_SIZE_MASK	(0xF)
#define CRC_INDEX_BITS 			(4)

typedef struct
{
   uint32            current_crc;       /**< Current CRC-value */
   uint8*            crc_source_buffer;  /**< Pointer to source data */
   uint16            crc_byte_count;     /**< Number of bytes in source buffer */
} CoCrcParamTye;

extern uint8 cocan_calc_j1850_crc8(const uint8 *data, uint8 len);
void cocan_init_crc32(CoCrcParamTye *crc_param_pointer);

void cocan_calc_crc32(CoCrcParamTye *crc_param_pointer);

#endif /* __COCAN_H__ */
